<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<table class="table table-striped table-hover x-table" style="margin-bottom:20px;">
  <thead>
    <tr>
      <th>类型</th>
      <th>金额</th>
      <th>申请时间</th>
      <th>打款时间</th>
      <th class="text-center">操作</th>
    </tr>
  </thead>
  <tbody>
    <c:forEach var="distributionRecord" items="${records}">
      <tr>
        <td>${distributionRecord.type.description}</td>
        <td><fmt:formatNumber value="${distributionRecord.offer/100}" maxFractionDigits="2" pattern="0.00"/></td>
        <td><fmt:formatDate value="${distributionRecord.occurTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
        <td><fmt:formatDate value="${distributionRecord.payTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
        <td class="text-center">
          <c:choose>
            <c:when test="${distributionRecord.type.withdrawing}">
              <a href="${ctx.host}/distributors/${distributor.id}/distribution-records/${distributionRecord.id}/pay" title="打款" data-toggle="modal" data-target="#record-pay">打款</a>
            </c:when>
            <c:otherwise>-</c:otherwise>
          </c:choose>
        </td>
      </tr>
    </c:forEach>
  </tbody>
</table>
<div class="form-horizontal clearfix">
  <jsp:include page="/WEB-INF/include/page.jsp">
    <jsp:param name="url" value="distributors/${distributor.id}/distribution-records" />
    <jsp:param name="queryString" value="${queryString}" />
  </jsp:include>
</div>